<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		圆的半径:<input type="text" id="input1" />
		<button onclick="calc()">计算</button>

		<script>
			console.log("π=" + Math.PI);

			function calc() {
				var r = parseFloat(input1.value)
				var area = Math.PI * r * r;
				alert("圆的面积:" + area);
			}


			console.log(Math.abs(-10));

			console.log(Math.round(4.4));
			console.log(Math.round(4.5));

			console.log(Math.ceil(4.5)); // 5
			console.log(Math.floor(4.5)); // 4

			console.log(Math.pow(2, 10));

			console.log(Math.sqrt(16));

			console.log(Math.random())
			console.log(Math.floor(Math.random() * 10 + 1));
			console.log(Math.floor(Math.random() * 3 + 1));
		</script>
		</script>
	</body>
</html>
